/**
 * 数字n的所有约数
 */
public enum ApproximateNumber {
    INSTANCE;

    public void v1(Integer num) {                //O(n)
        for (Integer i = 1; i <= num; i++) {
            if (num % i == 0) {
                System.out.println("约数 = " + i);
            }
        }
    }

    public void v2(Integer num) {              //O(根号n)
        for (Integer i = 1; i * i <= num; i++) {
            if (num % i == 0) {
                if (num / i == i) {
                    System.out.print(i + "  ");
                } else {
                    System.out.print(i + " " + num / i + " ");
                }
            }
        }
    }
}
